import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_widgets_pc/flutter_widgets_pc.dart';
import 'package:flutter_widgets_pc/flutter_widgets_pc_platform_interface.dart';
import 'package:flutter_widgets_pc/flutter_widgets_pc_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockFlutterWidgetsPcPlatform
    with MockPlatformInterfaceMixin
    implements FlutterWidgetsPcPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final FlutterWidgetsPcPlatform initialPlatform = FlutterWidgetsPcPlatform.instance;

  test('$MethodChannelFlutterWidgetsPc is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelFlutterWidgetsPc>());
  });

  test('getPlatformVersion', () async {
    FlutterWidgetsPc flutterWidgetsPcPlugin = FlutterWidgetsPc();
    MockFlutterWidgetsPcPlatform fakePlatform = MockFlutterWidgetsPcPlatform();
    FlutterWidgetsPcPlatform.instance = fakePlatform;

    expect(await flutterWidgetsPcPlugin.getPlatformVersion(), '42');
  });
}
